package com.power.project.model;



import com.power.common.domain.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.hibernate.annotations.Where;

import javax.persistence.*;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
*  项目实体类
*/

@Entity
@ApiModel(value="项目")
@Data
@Table(name="P_project")
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
//@IdClass(P_project.P_projectPK.class) 用于复合组件
public class P_project extends BaseModel implements Serializable {
	
	private static final long serialVersionUID = 1L;
	
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(nullable = false)
    @ApiModelProperty(value = "")
    private Integer id;

    @Column(nullable = false)
    @ApiModelProperty(value = "项目名称")
    private String projectname;

    @Column(nullable = false)
    @ApiModelProperty(value = "对方单位")
    private String clientcompany;

    @ApiModelProperty(value = "删除标记 0：未删除 1：删除")
    private Integer deleted;

    @ApiModelProperty(value = "是否结束")
    private Integer finished;

    @ApiModelProperty(value = "管理者ids")
    private String mgruserids;

    @ApiModelProperty(value = "版本号")
    private Integer version;

    @ApiModelProperty(value = "项目唯一标识")
    private String projectcode;

    @ApiModelProperty(value = "租户id")
    private String tenantid;


    public Map<String, Object> parseMap() {
        Map<String, Object> map=new HashMap<>();
        map.put("id", this.getId());
        map.put("projectname", this.getProjectname());
        map.put("clientcompany", this.getClientcompany());
        map.put("deleted", this.getDeleted());
        map.put("finished", this.getFinished());
        map.put("mgruserids", this.getMgruserids());
        map.put("version",this.getVersion());
        map.put("project_code",this.getProjectcode());
        map.put("tenantid",this.getTenantid());
        return map;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Serializable id) {
        this.id = (Integer) id;
    }

    public Serializable getPrimaryKey() {
        return id;
        // return new P_projectPK(id, id2); 用于复合主键，请手动创建内部静态类
    }

    public void setPrimaryKey(Serializable key) {
        this.id = (Integer)key;

        //P_projectPK pk = (P_projectPK) key; 用于复合主键
        //this.id = pk.getId();
        //this.id2 = pk.getId2();
    }

}